package domain;

import java.io.Serializable;
import javax.persistence.*;

/**
 * The primary key class for the deelnemer database table.
 * 
 */
@Embeddable
public class DeelnemerPK implements Serializable {
	//default serial version id, required for serializable classes.
	private static final long serialVersionUID = 1L;

	@Column(name="persoon_id", unique=true, nullable=false)
	private int persoonId;

	@Column(name="reservering_id", unique=true, nullable=false)
	private int reserveringId;

    public DeelnemerPK() {
    }
	public int getPersoonId() {
		return this.persoonId;
	}
	public void setPersoonId(int persoonId) {
		this.persoonId = persoonId;
	}
	public int getReserveringId() {
		return this.reserveringId;
	}
	public void setReserveringId(int reserveringId) {
		this.reserveringId = reserveringId;
	}

	public boolean equals(Object other) {
		if (this == other) {
			return true;
		}
		if (!(other instanceof DeelnemerPK)) {
			return false;
		}
		DeelnemerPK castOther = (DeelnemerPK)other;
		return 
			(this.persoonId == castOther.persoonId)
			&& (this.reserveringId == castOther.reserveringId);

    }
    
	public int hashCode() {
		final int prime = 31;
		int hash = 17;
		hash = hash * prime + this.persoonId;
		hash = hash * prime + this.reserveringId;
		
		return hash;
    }
}